package com.wx.controller.api;

import com.wx.common.WrapMapper;
import com.wx.common.Wrapper;
import com.wx.entity.SysBanner;
import com.wx.service.SysBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>Title:	  weixin-go-with-you <br/> </p>
 * <p>Description TODO <br/> </p>
 * <p>Company:    医百科技有限公司  <br/> </p>
 *
 * @Author <a href="yangwensheng@100doc.com.cn"/>杨文生</a>  <br/>
 * @Date 2021/4/5 21:26
 */
@RestController
@RequestMapping(value = "/api/banner", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(tags = "轮播图管理(API)", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class ApiBannerController {

    @Resource
    private SysBannerService sysBannerService;


    @PostMapping(value = "/list")
    @ApiOperation(httpMethod = "POST", value = "轮播图查询")
    public Wrapper<List<SysBanner>> list() {
        List<SysBanner> bannerList = sysBannerService.selectLastBanner();
        return WrapMapper.wrap(Wrapper.SUCCESS_CODE, Wrapper.SUCCESS_MESSAGE, bannerList);
    }
}
